<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class budget_ctr extends CI_Controller 
{

	public function index()
	{
		$session = $this->session;
		$login_state =$this->session->userdata('login_state');
		if (!$login_state) 
		{
		//// go to login
		$this->load->view('login_vew');
		}
		else
		{
		echo('welcome '.$this->session->userdata('user_name'));	
		//echo('<a href="session_ctr/logout">logout</a>');
		echo('<a href="'.$this->logout().'">logout</a>');
		}
			
	}
	
	
	
	
	public function load()
	{
		$session = $this->session;
		$login_state =$this->session->userdata('login_state');
		if (!$login_state) 
		{
		//// go to login
		$this->load->view('login_vew');
		}
		else
		{
		 $this->load->library('session');
		$an=$this->input->post('annee');
		$annee['annee']=$an;
		if($an){
				$this->session->set_userdata($annee); // mettre $annee dans une var globale
		}
	
		$this->load->view('budget_vew');  // send the result from the model to the view 
	
		}
		
	}
	
	
}

/* End of file welcome.php */
/* Location: ./application/controllers/welcome.php */